//
//  ViewController.m
//  10502
//
//  Created by student on 16/2/19.
//  Copyright © 2016年 NIIT. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (IBAction)creat:(UIButton *)sender
{
//    NSString *s=@"我叫name我age岁我是class的学生";
//    NSMutableString *string=[s mutableCopy];
//    NSRange range;
//    range=[string rangeOfString:@"name"];
//    if(range.location != NSNotFound)
//    {
//    [string replaceCharactersInRange:range withString:self.nametext.text];
//    }
//    range=[string rangeOfString:@"age"];
//    if(range.location != NSNotFound)
//    {
//    [string replaceCharactersInRange:range withString:self.agetext.text];
//    }
//    range=[string rangeOfString:@"class"];
//    if(range.location != NSNotFound)
//    {
//    [string replaceCharactersInRange:range withString:self.classtext.text];
//    }
//    NSLog(@"%@",string);
//    self.textview.text=string;
    NSString *text=[NSString stringWithFormat:@"我叫%@我%@岁我是%@的学生",self.nametext.text,self.agetext.text,self.classtext.text];
    self.textview.text=text;
}
- (IBAction)back:(id *)sender
{
    [self.view endEditing:YES];
}
@end
